<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<head>
    <title>新增电子书</title>
    <script type="text/javascript" src="js/jquery-1.11.0.js"></script>
    <script type="text/javascript">

        function jumpebooklist(){
            window.location.href="${pageContext.request.contextPath}/ebook/list";
        }



        function checkfrom(){
            var title=$("input[name='title']").val();
            var createdate=$("input[name='createdate']").val();
            if(title==''){
                flag=false;
                alert("标题不能为空");
            }else if(createdate==''){
                flag=false;
                alert("日期不能为空");
            }
            return flag;
        }




    </script>
</head>
<body>
<form action="${pageContext.request.contextPath}/ebook/dosave" method="post" >
    <table border="1" align="center">
        <tr><td colspan ="2" align="center" style="font-size:30px;background-color: #b0e0e6 ">增加电子图书</td></tr>

        <tr>
            <td>图书名称<span> (*)</span></td>
            <td><input type="text" name="title" /></td>
        </tr>

        <tr>
            <td>图书摘要</td>
            <td><textarea rows="10" name="summary" cols="50"></textarea></td>
        </tr>

        <tr>
            <td>上传人</td>
            <td><input type="text" name="uploaduser" /></td>
        </tr>

        <tr>
            <td>上传时间<span> (*)</span></td>
            <td><input type="text" name="createdate" />(yyyy-MM-dd)</td>
        </tr>

        <tr>
            <td>类别</td>
            <td><select name="categoryId">
                <option value="0">==不限==</option>
                <c:forEach var="item" items="${plist}">
                    <option <c:if test="${item.id==ebook.categoryId}">selected="selected"</c:if> value="${item.id}">${item.typeName}</option>
                </c:forEach>
            </select></td>
        </tr>



        <tr >
            <td colspan ="2" align="center">
                <input type="submit" value="提交"   />
                <input type="button" value="返回" onclick=javascrtpt:jumpebooklist() />
            </td>
        </tr>

    </table>


</form>
</body>
</html>